﻿<!DOCTYPE html>
<html>
<head>
    <title></title>
    <link href="~/Content/css/framework-font.css" rel="stylesheet" />
    <link href="~/Content/css/framework-ui.css" rel="stylesheet" />
    <script src="~/Content/js/jquery/jquery-2.1.1.min.js"></script>
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <link href="~/Content/js/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="~/Content/js/bootstrap/bootstrap.js"></script>
    <link href="~/Content/css/framework-theme.css" rel="stylesheet" />
    <link href="~/Content/js/dialog/dialog.css" rel="stylesheet" />
    <script src="~/Content/js/dialog/dialog.js"></script>
    <script src="~/Content/js/charts/Chart.js"></script>
    <script src="~/Content/js/framework-ui.js"></script>
    <style>
       
    </style>
    <script>
        $(function () {
            getCountData();
            GetNewsTop();
            GetNoticeTop();
            GetMessageTop();
        });

        function getCountData() {
            $.ajax({
                type: 'post',
                url: '/Home/GetDataCountForMember',
                dataType: "json",
                async: true,
                success: function (data) {
                    //alert(data.teamConsume);
                    $('#teamCount').html(data.teamCount);
                    $('#teamConsume').html(data.teamConsume);
                    $('#memberConsume').html(data.memberConsume);
                    $('#memberBonus').html(data.memberBonus);
                    $('#memberProperty').html(data.memberProperty);
                    if (data.userlevelA > -1) {
                        //$('#levelmoney')

                        $('#level').text(data.userlevelA+"星经理");
                    } else {
                        if (parseInt(data.userlevel) > -1) {
                            if (parseFloat(data.lastMoney) > 0)
                                $('#levelmoney').html("距离升级还差" + data.lastMoney + "积分");
                            $('#level').html(data.userlevel + "星会员");
                        }
                        else {
                            $('#level').html("无效会员");
                        }
                    }
                }
            });
        }

        


        

        function GetNewsTop() {
            var $shopTop = $('#sysNews');
            $.ajax({
                type: 'post',
                url: '/Home/GetNewsTop',
                dataType: 'json',
                async: false,
                beforeSend: function () {
                    $shopTop.html('<li>正在加载数据......</li><span class="time"></span>');
                },
                success: function (json) {
                    setTimeout(function () {
                            var _html = '';
                            for (var i = 0, len = json.length; i < len; i++)
                                _html += '<li><a href="#" onclick="btn_details(\'' + json[i].F_Id + '\')">' +
                                    json[i].F_Title +
                                    '</a><span class="time">' +
                                    json[i].F_CreatorTime +
                                    '</span></li>';
                            $shopTop.html(_html);
                        },
                        2000);
                }
            });
        }

        function GetNoticeTop() {
            var $shopTop = $('#sysNotice');
            $.ajax({
                type: 'post',
                url: '/Home/GetNoticeTop',
                dataType: 'json',
                async: false,
                beforeSend: function () {
                    $shopTop.html('<li>正在加载数据......</li><span class="time"></span>');
                },
                success: function (json) {
                    setTimeout(function () {
                            var _html = '';
                            for (var i = 0, len = json.length; i < len; i++)
                                _html += '<li><a href="#" onclick="btn_details(\'' + json[i].F_Id + '\')">' +
                                    json[i].F_Title +
                                    '</a><span class="time">' +
                                    json[i].F_CreatorTime +
                                    '</span></li>';
                            $shopTop.html(_html);
                        },
                        2000);
                }
            });
        }
        
        function GetMessageTop() {
            var $msg = $('#unreadMessages');
            $.ajax({
                type: 'post',
                url: '/Home/GetMessageTop',
                dataType: 'json',
                async: false,
                beforeSend: function () {
                    $msg.html('<li>正在加载数据......</li><span class="time"></span>');
                },
                success: function (json) {
                    setTimeout(function () {
                        var _html = '';
                        if (json.length > 0) {
                            for (var i = 0, len = json.length; i < len; i++)
                                _html += '<li><a href="#" onclick="btn_viewMsg(\'' +
                                    json[i].F_Id +
                                    '\')">' +
                                    json[i].F_Title +
                                    '</a><span class="time">' +
                                    json[i].F_CreatorTime +
                                    '</span></li>';
                        } else {
                            _html = '<li>暂无未读留言</li><span class="time"></span>';
                        }
                        $msg.html(_html);
                    }, 2000);
                }
            });
        }

        function btn_details(id) {
            $.modalOpen({
                id: "Details",
                title: "平台信息查看",
                url: "/InformationCenter/News/Details?keyValue=" + id,
                width: "950px",
                height: "710px",
                btn: null
            });
        }
        function btn_viewMsg(id) {
            $.modalOpen({
                id: "ViewMessage",
                title: "查看留言",
                url: "/InformationCenter/Messages/ViewReply?keyValue=" + id,
                width: "950px",
                height: "710px",
                btn: null
            });
        }

    </script>

</head>
<body>
    <div id="areascontent">
        <div class="rows" style="margin-bottom: 1%; border: 1px solid #e6e6e6; overflow: hidden; padding-left: 1px;">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <i class="fa fa-line-chart fa-lg" style="padding-right: 5px;"></i>关键数据实时指标
                    <div style="float: right; position: relative; top: -4px; right: 0px;">
                        <iframe name="weather_inc" src="http://i.tianqi.com/index.php?c=code&id=1" width="330" height="35" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
                    </div>
                </div>
                <div class="panel-body">
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #65cea7;">
                            <h2 id="level" class="m-top-none">0</h2>
                            <h5 id="levelmoney"></h5>
                            <div class="stat-icon">
                                <i class="fa fa-group fa-3x"></i>
                            </div>
                        </div>
                    </div>
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #fc8675;">
                            <h2 class="m-top-none" id="teamCount">0</h2>
                            <h5>部门代理商数量</h5>
                            <div class="stat-icon">
                                <i class="fa fa-group fa-3x"></i>
                            </div>
                        </div>
                    </div>
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #6bafbd;">
                            <h2 class="m-top-none" id="teamConsume">0.00</h2>
                            <h5>部门本月消费额</h5>
                            <div class="stat-icon">
                                <i class="fa fa-jpy fa-3x"></i>
                            </div>
                        </div>
                    </div>
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #f3ce85;">
                            <h2 class="m-top-none" id="memberConsume">0.00</h2>
                            <h5>代理商本月消费额</h5>
                            <div class="stat-icon">
                                <i class="fa fa-jpy fa-3x"></i>
                            </div>
                        </div>
                    </div>
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #949FB1;">
                            <h2 class="m-top-none" id="memberBonus">0.00</h2>
                            <h5>代理商本月积分总数</h5>
                            <div class="stat-icon">
                                <i class="fa fa-jpy fa-3x"></i>
                            </div>
                        </div>
                    </div>
                    <div class="dashboard-stats">
                        <div class="dashboard-stats-item" style="background-color: #65cea7; margin-right: 0px;">
                            <h2 class="m-top-none" id="memberProperty">0.00</h2>
                            <h5>会员积分余额</h5>
                            <div class="stat-icon">
                                <i class="fa fa-jpy fa-3x"></i>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        

        
        
        

        <div class="rows" style="overflow: hidden;">
            <div style="float: left; width: 34%; margin-right: 1%;">
                <div style="height: 650px; border: 1px solid #e6e6e6; background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading"><i class="fa fa-thumbs-o-up fa-lg" style="padding-right: 5px;"></i>平台新闻</div>
                        <div class="panel-body">
                            <ul id="sysNews">
                                
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div style="float: left; width: 34%; margin-right: 1%;">
                <div style="height: 650px; border: 1px solid #e6e6e6; background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading"><i class="fa fa-rss fa-lg" style="padding-right: 5px;"></i>通知公告</div>
                        <div class="panel-body">
                            <ul id="sysNotice">
                                
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div style="float: right; width: 30%;">
                <div style="height: 650px; border: 1px solid #e6e6e6; background-color: #fff;">
                    <div class="panel panel-default">
                        <div class="panel-heading"><i class="fa fa-send fa-lg" style="padding-right: 5px;"></i>未读留言</div>
                        <div class="panel-body">
                            <ul id="unreadMessages">
                                @*<li><a href="#">【通知】新版员工守则，即日执行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】OA办公使用指南</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】劳动节集体出游指南</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】2016年G20财长和央行行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】2016年G20财长和央行行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】品牌价值的最佳选择</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】新版员工守则，即日执行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】OA办公使用指南</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】劳动节集体出游指南</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】2016年G20财长和央行行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】2016年G20财长和央行行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】品牌价值的最佳选择</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】2016年G20财长和央行行</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【通知】品牌价值的最佳选择</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>
                                <li><a href="#">【公告】采购商城全新升级自营业正品</a><span class="time">2016-07-21</span></li>*@
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style>
        #copyrightcontent {
            height: 30px;
            line-height: 29px;
            overflow: hidden;
            position: absolute;
            top: 100%;
            margin-top: -30px;
            width: 100%;
            background-color: #fff;
            border: 1px solid #e6e6e6;
            padding-left: 10px;
            padding-right: 10px;
        }

        .dashboard-stats {
            float: left;
            width: 16.66%;
        }

        .dashboard-stats-item {
            position: relative;
            overflow: hidden;
            color: #fff;
            cursor: pointer;
            height: 105px;
            margin-right: 25px;
            margin-bottom: 10px;
            padding: 20px 20px;
        }

        .dashboard-stats-item .m-top-none {
            margin-top: 2px;
        }

        .dashboard-stats-item h2 {
            font-size: 35px;
            font-family: inherit;
            line-height: 1.1;
            font-weight: 500;
        }

        .dashboard-stats-item h5 {
            font-size: 14px;
            font-family: inherit;
            margin-top: 3px;
            line-height: 1.1;
        }


        .dashboard-stats-item .stat-icon {
            position: absolute;
            top: 10px;
            right: 10px;
            font-size: 30px;
            opacity: .3;
        }

        .dashboard-stats i.fa.stats-icon {
            width: 50px;
            padding: 20px;
            font-size: 50px;
            text-align: center;
            color: #fff;
            height: 50px;
            border-radius: 10px;
        }

        .panel-default {
            border: none;
            border-radius: 0px;
            margin-bottom: 0px;
            box-shadow: none;
            -webkit-box-shadow: none;
        }

        .panel-default > .panel-heading {
            color: #777;
            background-color: #fff;
            border-color: #e6e6e6;
            padding: 10px 10px;
        }

        .panel-default > .panel-body {
            padding: 10px;
            padding-bottom: 0px;
        }

        .panel-default > .panel-body ul {
            overflow: hidden;
            padding: 0;
            margin: 0px;
            margin-top: -5px;
        }

        .panel-default > .panel-body ul li {
            line-height: 27px;
            list-style-type: none;
            white-space: nowrap;
            text-overflow: ellipsis;
        }

        .panel-default > .panel-body ul li .time {
            color: #a1a1a1;
            float: right;
            padding-right: 5px;
        }
    </style>
</body>
</html>
